﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SoundServant.Controls;
using System.IO;
using System.Threading;

namespace SoundServant
{
    /// <summary>
    /// Interaction logic for AddCD.xaml
    /// </summary>
    public partial class SnapshotSkypeWindow : Window
    {
        Sharing sharing;
        Congregation cong;

        public SnapshotSkypeWindow(Sharing _sharing, Congregation _cong)
        {
            InitializeComponent();

            sharing = _sharing;
            cong = _cong;
        }

        private void OpenSkypeButton_Click(object sender, RoutedEventArgs e)
        {
            sharing.OpenSkypeRequest();

        }

        private void SnapshotSkypeButton_Click(object sender, RoutedEventArgs e)
        {

            SaveSkypeConfigurationWindow.Execute(cong, sharing.skype);
            sharing.Initialize();
        }

        private void CancelButton_Click_1(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        public static new void Show(Sharing _sharing, Congregation _cong)
        {
            SnapshotSkypeWindow snapshotSkypeWindow = new SnapshotSkypeWindow(_sharing, _cong);
            snapshotSkypeWindow.ShowDialog();
        }

        private void AttachButton_Click(object sender, RoutedEventArgs e)
        {
            sharing.AttachRequest();
        }

        private void CloseSkype_Click(object sender, RoutedEventArgs e)
        {
            if (sharing.skype.Client.IsRunning)
                sharing.skype.Client.Shutdown();
        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void SilentButton_Click(object sender, RoutedEventArgs e)
        {
            sharing.skype.SilentMode = true;
        }

    }
}
